package com.service.impl;

import java.util.List;

import com.dao.SubTypeDao;
import com.dao.SuperTypeDao;
import com.dao.impl.SubTypeDaoImpl;
import com.dao.impl.SuperTypeDaoImpl;
import com.model.SubType;
import com.model.SuperType;
import com.service.TypeService;

public class TypeServiceImpl implements TypeService {
	
	
	private SuperTypeDao superTypeDao=new SuperTypeDaoImpl();
	
	private SubTypeDao subTypeDao=new SubTypeDaoImpl();

	@Override
	public List<SuperType> queryAllSuperType() {
		
		
		
		return superTypeDao.queryAllSuperType();
	}

	@Override
	public List<SubType> querySubTypesBySuperId(Integer superId) {
		
		return subTypeDao.querySubTypesBySuperId(superId);
	}

	@Override
	public List<SubType> querAllSubTypes() {	
		return subTypeDao.querAllSubTypes() ;
	}

	@Override
	public SuperType querySuperTypeByName(String typename) {
		// TODO Auto-generated method stub
		return superTypeDao.querySuperTypeByName(typename);
	}

	@Override
	public boolean insertSuperType(SuperType type) {
		// TODO Auto-generated method stub
		return superTypeDao.insert(type)>0;
	}

	@Override
	public List<SubType> querySubTypesBySuperIds(String superTypeId) {
		
		return subTypeDao.querySubTypesBySuperIds(superTypeId);
	}

	@Override
	public boolean deleteSupperTypeByIds(String superTypeId) {
	
		return superTypeDao.deleteSupperbTypeByIds(superTypeId)>0;
	}

	@Override
	public SubType querySubTypeByName(String typename) {
		
		return subTypeDao.querySubTypeByName(typename);
	}

	@Override
	public boolean insertSubType(SubType type) {
	
		return subTypeDao.insert(type)>0;
	}

	@Override
	public boolean deleteSubTypeByIds(String subTypeId) {
		
		return subTypeDao.deleteSubTypeByIds(subTypeId)>0;
	}

}
